package com.itheima.Properties;

import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
import java.util.Scanner;

/**
 * @Author 王加鑫
 * @Date 2021/5/20 19:18
 * @Version 1.0
 */
public class Demo {
    public static void main(String[] args) throws IOException {
        Properties properties = new Properties();
        properties.load(new FileReader("day13_字符流/demo.properties"));
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入账号:");
        String username = sc.next();
        System.out.println("请输入密码:");
        String password = sc.next();

        String realPassword = properties.getProperty(username);
        if(password.equals(realPassword)){
            System.out.println("登录成功");
        }else {
            System.out.println("登录失败");
        }

    }
}
